const app = getApp()
import { requestApi } from '../../../api'

Page({

  /**
   * 页面的初始数据
   */
  data: {
    protocol_name: '',
    dataInfo: [],
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      protocol_name: options.protocol_name
    })

    if (options.protocol_name == 'logistics_commission_protocol') {
      wx.setNavigationBarTitle({
        title: '物流委托协议',
      })
    }

    this.getProtocolContent()
  },

  getProtocolContent: function () {
    app.request({
      url: requestApi.getProtocolContentUrl,
      login: false,
      data: {
        protocol_name: this.data.protocol_name
      },
    }, (data) => {
      this.setData({
        dataInfo: data.original.data
      })
    }, (error) => {
      wx.showModal({
        title: '提示',
        showCancel: false,
        content: error,
      })
    })
  },
  
})